const { DataTypes } = require('sequelize');

const seq = require('@db/sql');

const address = seq.define('t_address', {
  consignee: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: '收货人',
  },
  phone: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: '手机号',
  },
  address: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: '地址',
  },
  user_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
    comment: '用户ID',
  },
  is_default: {
    type: DataTypes.BOOLEAN,
    allowNull: false,
    defaultValue: false,
    comment: '是否默认',
  },
});

// address.sync({ alter: true });

module.exports = address;
